﻿using CsvHelper;
using MemoryPack;
using NPOI.HSSF.Record;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace 基于WPF的电缆采样数据分析系统.Tools
{
    [MemoryPackable]
    public partial class TDRDataCsv
    {

        public static List<float> LoadWav(string path)
        {
            // 文件路径是否存在该文件
            if (!File.Exists(path))
            {
                return null;
            }

            List<float> records;

            using (var reader = new StreamReader(path))
            using (var csv = new CsvReader(reader, CultureInfo.InvariantCulture))
            {
                records = csv.GetRecords<float>().ToList();
            }

            return records;
        }
    }
}
